#include "Chat.h"
#include "ui_chat.h"

Chat::Chat(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Chat)
{
    ui->setupUi(this);
    connect(ui->send, SIGNAL(clicked()), this, SLOT(sendTo()));
}

Chat::~Chat()
{
    delete ui;
}

void Chat::sendTo()
{
    emit newMsg(ui->line->text()+"\n");
}


void Chat::displayMsg(QString msg)
{
    ui->receive->setPlainText(ui->receive->toPlainText()+msg);

}
